// tslint:disable
import { Component, OnInit, Input } from '@angular/core';
import { ModalController, Platform } from '@ionic/angular';
import { Router } from '@angular/router';
import { AlertController } from '@ionic/angular';
import { AppGlobalService } from 'src/app/shared/service/app-global.service';
@Component({
    templateUrl: 'about-us.page.html',
    styleUrls: ['about-us.scss']
})
export class AboutUsPage implements OnInit {
    contentArray: any;
    appTypeCustom: any;
    targetObj: any; // 路由对象
    ifLogin: boolean;
    @Input() tagData: any = {};
    privacyStatement = '隐私政策';
    constructor(
        private alertController: AlertController,
        public router: Router,
        private modalCtrl: ModalController,
        private appGlobalService: AppGlobalService
    ) {
    }
    ngOnInit() {
        const bodyStyles = window.getComputedStyle(document.body);
        this.appTypeCustom = bodyStyles.getPropertyValue('--appTypeCustom').trim().replace('"', '').replace('"', '');
        this.ifLogin = localStorage.getItem('userId') !== 'null';
        if (localStorage.getItem('localAppVersion')) {
            console.log('localAppVersion ----->:' + localStorage.getItem('localAppVersion'));
            this.tagData.data.version = localStorage.getItem('localAppVersion');
        }
        if (this.appTypeCustom === 'LJ') {
            this.contentArray = ["蜂喔商户App是为从事商铺、写字楼、厂房、租房、二手房和新房买卖的中介业务人员和公司提供客户和房源信息并促进成交的平台。", "通过平台的多种收费和服务形式，同城百万业务员相互协助来促进成交、不仅使客户成交速度加快，也使业务人员有了多渠道的收入来源，相比传统中介业务收入更高。", "0成本开店，0成本做业务，平台只按您的业绩收取小比例管理服务费。", "工作方式灵活、自由，适合各种人士。", "欢迎个人、公司入驻蜂喔平台，共同开创开放式、协同式的业务与服务模式,让您有一个收入高又自由的工作和事业。"];
        } else {
            if (this.tagData.data.agreement && !Array.isArray(this.tagData.data.agreement)) {
                this.tagData.data.agreement = [
                    { label: { name: this.tagData.data.agreement.label } },
                    { label: { name: this.privacyStatement } }
                ];
            }
        }
    }
    dismiss() {
        this.appGlobalService.goBack();
    }
    async openArgument() {
        this.appGlobalService.openUrl("服务协议",this.appGlobalService.serviceAgreementLink);
    }
    async alertPrivacyPolicy() {
        this.appGlobalService.openUrl("隐私权限",this.appGlobalService.privatePolicyLink);
    }


}
